/**
 * @file 日志处理接口定义
 * @description 定义日志处理相关的数据结构和接口
 * @author AI Assistant
 * @date 2024-03-09
 */

import { RawGpsLogData } from './raw-gps-log-data.interface';
import { GpsLogData } from './gps-log-data.interface';

/**
 * 处理统计信息
 */
export interface ProcessingStats {
  totalLines: number;
  parsedCount: number;
  processedCount: number;
  filteredCount: number;
  errorCount: number;
  startTime?: number;
  endTime?: number;
  filePath?: string;
  isSuccess?: boolean;
}

/**
 * 文件处理结果
 */
export interface FileProcessingResult {
  isSuccess: boolean;
  stats: ProcessingStats;
  error?: string;
}

/**
 * 行处理结果
 */
export interface LineProcessingResult {
  rawData?: RawGpsLogData;
  processedData?: GpsLogData;
  isFiltered: boolean;
  status: 'success' | 'filtered' | 'error';
  error?: string;
}

/**
 * 批处理配置
 */
export interface BatchConfig {
  batchSize: number;
  commitThreshold: number;
  logProgressInterval: number;
}

/**
 * 处理任务状态
 */
export enum ProcessingTaskStatus {
  QUEUED = 'queued',
  PROCESSING = 'processing',
  COMPLETED = 'completed',
  FAILED = 'failed'
}

/**
 * 处理任务信息
 */
export interface ProcessingTaskInfo {
  taskId: string;
  deviceId?: string;
  filePath: string;
  status: ProcessingTaskStatus;
  progress: number; // 0-100
  stats: Partial<ProcessingStats>;
  startTime: Date;
  endTime?: Date;
  error?: string;
  duplicatesFiltered?: number;
}

/**
 * 任务进度更新
 */
export interface TaskProgressUpdate {
  taskId: string;
  progress: number;
  stats: Partial<ProcessingStats>;
} 